package com.niiwoo.civet.trade.service.local.notify.impl;

import com.niiwoo.civet.trade.dto.ProjectNotifyDTO;
import com.niiwoo.civet.trade.enums.NotifyTypeEnum;
import com.niiwoo.civet.trade.service.local.notify.AbstractNotifier;
import com.niiwoo.civet.user.dto.request.AppButtonDTO;
import com.niiwoo.civet.user.dto.request.JPushExtDTO;
import com.niiwoo.civet.user.dto.request.UserLetterRequestDTO;
import com.niiwoo.civet.user.enums.JPushEnum;
import com.niiwoo.civet.user.enums.MessageTemplateKeyEnum;
import com.niiwoo.civet.user.enums.SMSTemplateKeyEnum;
import com.niiwoo.civet.user.enums.UserLetterTypeEnum;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

@Component
public class CardNiuProjectFlowMiscarryManualFailedNotifier extends AbstractBorrowNotifier<ProjectNotifyDTO> {

    @Override
    protected List<? extends UserNotifyInfo> getUserNotifyInfoList(ProjectNotifyDTO t) {
        BorrowUserNotifyInfo info = new BorrowUserNotifyInfo();
        info.setUserId(t.getBorrowUserId());
        info.setProjectId(t.getProjectId());
        info.setProjectTitle(t.getTitle());
        info.setMobileNo(privacyMasks.decryptPrivacy(t.getBorrowMobile()));
        info.setPushContent(t.getPushContent());
        info.setProjectType(t.getType());
        info.setProjectFrom(t.getFromSource());
        return Collections.singletonList(info);
    }

    @Override
    protected UserLetterRequestDTO getUserLetterRequestDTO(UserNotifyInfo info) {
        return null;
    }


    @Override
    protected SMSTemplateKeyEnum getSMSTemplateKey() {
        return SMSTemplateKeyEnum.CARD_NIU_PROJECT_FLOW_MISCARRY_MANUAL_FAILED;
    }

    @Override
    protected List<Object> getSMSParameterList(BorrowUserNotifyInfo info) {
        return Arrays.asList(info.getProjectTitle(), info.getPushContent());
    }

    @Override
    protected NotifyTypeEnum getType() {
        return NotifyTypeEnum.CARD_JS005;
    }

}
